package model

import (
	"github.com/labstack/gommon/log"
)

func Login(username string) (bool,*Users) {
	sess := engine.NewSession()
	user := new(Users)
	has , err := sess.Table(user.TableName()).Where("username = ?",username).Get(user)
	if err != nil {
		log.Errorf("find user err:%+v",err)
	}
	return has, user
}
